package io.github.chutian0610.sqlparser.token

import java.util.*

/** KeyWords with UpperCase Text.
 *
 *   1. a list of KeyWord used in sql.
 *   2. some of these can be parsed as identifiers according to parser.
 * @param text
 *   keyword string value
 */
enum class KeyWordEnum(val text: String) {
    ABORT("ABORT"),
    ABS("ABS"),
    ABSENT("ABSENT"),
    ABSOLUTE("ABSOLUTE"),
    ACCESS("ACCESS"),
    ACCOUNT("ACCOUNT"),
    ACTION("ACTION"),
    ADD("ADD"),
    ADMIN("ADMIN"),
    AFTER("AFTER"),
    AGAINST("AGAINST"),
    AGGREGATE("AGGREGATE"),
    AGGREGATION("AGGREGATION"),
    ALERT("ALERT"),
    ALGORITHM("ALGORITHM"),
    ALIAS("ALIAS"),
    ALL("ALL"),
    ALLOCATE("ALLOCATE"),
    ALTER("ALTER"),
    ALWAYS("ALWAYS"),
    ANALYZE("ANALYZE"),
    AND("AND"),
    ANTI("ANTI"),
    ANY("ANY"),
    APPLICATION("APPLICATION"),
    APPLY("APPLY"),
    APPLYBUDGET("APPLYBUDGET"),
    ARCHIVE("ARCHIVE"),
    ARE("ARE"),
    ARRAY("ARRAY"),
    ARRAY_MAX_CARDINALITY("ARRAY_MAX_CARDINALITY"),
    AS("AS"),
    ASC("ASC"),
    ASENSITIVE("ASENSITIVE"),
    ASOF("ASOF"),
    ASSERT("ASSERT"),
    ASYMMETRIC("ASYMMETRIC"),
    AT("AT"),
    ATOMIC("ATOMIC"),
    ATTACH("ATTACH"),
    AUDIT("AUDIT"),
    AUTHENTICATION("AUTHENTICATION"),
    AUTHORIZATION("AUTHORIZATION"),
    AUTO("AUTO"),
    AUTOEXTEND_SIZE("AUTOEXTEND_SIZE"),
    AUTOINCREMENT("AUTOINCREMENT"),
    AUTO_INCREMENT("AUTO_INCREMENT"),
    AVG("AVG"),
    AVG_ROW_LENGTH("AVG_ROW_LENGTH"),
    AVRO("AVRO"),
    BACKWARD("BACKWARD"),
    BASE64("BASE64"),
    BASE_LOCATION("BASE_LOCATION"),
    BEFORE("BEFORE"),
    BEGIN("BEGIN"),
    BEGIN_FRAME("BEGIN_FRAME"),
    BEGIN_PARTITION("BEGIN_PARTITION"),
    BERNOULLI("BERNOULLI"),
    BETWEEN("BETWEEN"),
    BIGDECIMAL("BIGDECIMAL"),
    BIGINT("BIGINT"),
    BIGNUMERIC("BIGNUMERIC"),
    BINARY("BINARY"),
    BIND("BIND"),
    BINDING("BINDING"),
    BIT("BIT"),
    BLOB("BLOB"),
    BLOCK("BLOCK"),
    BLOOM("BLOOM"),
    BLOOMFILTER("BLOOMFILTER"),
    BOOL("BOOL"),
    BOOLEAN("BOOLEAN"),
    BOTH("BOTH"),
    BOX("BOX"),
    BRIN("BRIN"),
    BROWSE("BROWSE"),
    BTREE("BTREE"),
    BUCKET("BUCKET"),
    BUCKETS("BUCKETS"),
    BY("BY"),
    BYPASSRLS("BYPASSRLS"),
    BYTEA("BYTEA"),
    BYTES("BYTES"),
    CACHE("CACHE"),
    CALL("CALL"),
    CALLED("CALLED"),
    CARDINALITY("CARDINALITY"),
    CASCADE("CASCADE"),
    CASCADED("CASCADED"),
    CASE("CASE"),
    CASES("CASES"),
    CAST("CAST"),
    CATALOG("CATALOG"),
    CATALOG_SYNC("CATALOG_SYNC"),
    CATCH("CATCH"),
    CEIL("CEIL"),
    CEILING("CEILING"),
    CENTURY("CENTURY"),
    CHAIN("CHAIN"),
    CHANGE("CHANGE"),
    CHANGE_TRACKING("CHANGE_TRACKING"),
    CHANNEL("CHANNEL"),
    CHAR("CHAR"),
    CHARACTER("CHARACTER"),
    CHARACTERISTICS("CHARACTERISTICS"),
    CHARACTERS("CHARACTERS"),
    CHARACTER_LENGTH("CHARACTER_LENGTH"),
    CHARSET("CHARSET"),
    CHAR_LENGTH("CHAR_LENGTH"),
    CHECK("CHECK"),
    CHECKSUM("CHECKSUM"),
    CIRCLE("CIRCLE"),
    CLEAR("CLEAR"),
    CLOB("CLOB"),
    CLONE("CLONE"),
    CLOSE("CLOSE"),
    CLUSTER("CLUSTER"),
    CLUSTERED("CLUSTERED"),
    CLUSTERING("CLUSTERING"),
    COALESCE("COALESCE"),
    COLLATE("COLLATE"),
    COLLATION("COLLATION"),
    COLLECT("COLLECT"),
    COLLECTION("COLLECTION"),
    COLUMN("COLUMN"),
    COLUMNS("COLUMNS"),
    COLUMNSTORE("COLUMNSTORE"),
    COMMENT("COMMENT"),
    COMMIT("COMMIT"),
    COMMITTED("COMMITTED"),
    COMPATIBLE("COMPATIBLE"),
    COMPRESSION("COMPRESSION"),
    COMPUTE("COMPUTE"),
    CONCURRENTLY("CONCURRENTLY"),
    CONDITION("CONDITION"),
    CONFLICT("CONFLICT"),
    CONNECT("CONNECT"),
    CONNECTION("CONNECTION"),
    CONNECTOR("CONNECTOR"),
    CONNECT_BY_ROOT("CONNECT_BY_ROOT"),
    CONSTRAINT("CONSTRAINT"),
    CONTAINS("CONTAINS"),
    CONTINUE("CONTINUE"),
    CONVERT("CONVERT"),
    COPY("COPY"),
    COPY_OPTIONS("COPY_OPTIONS"),
    CORR("CORR"),
    CORRESPONDING("CORRESPONDING"),
    COUNT("COUNT"),
    COVAR_POP("COVAR_POP"),
    COVAR_SAMP("COVAR_SAMP"),
    CREATE("CREATE"),
    CREATEDB("CREATEDB"),
    CREATEROLE("CREATEROLE"),
    CREDENTIALS("CREDENTIALS"),
    CROSS("CROSS"),
    CSV("CSV"),
    CUBE("CUBE"),
    CUME_DIST("CUME_DIST"),
    CURRENT("CURRENT"),
    CURRENT_CATALOG("CURRENT_CATALOG"),
    CURRENT_DATE("CURRENT_DATE"),
    CURRENT_DEFAULT_TRANSFORM_GROUP("CURRENT_DEFAULT_TRANSFORM_GROUP"),
    CURRENT_PATH("CURRENT_PATH"),
    CURRENT_ROLE("CURRENT_ROLE"),
    CURRENT_ROW("CURRENT_ROW"),
    CURRENT_SCHEMA("CURRENT_SCHEMA"),
    CURRENT_TIME("CURRENT_TIME"),
    CURRENT_TIMESTAMP("CURRENT_TIMESTAMP"),
    CURRENT_TRANSFORM_GROUP_FOR_TYPE("CURRENT_TRANSFORM_GROUP_FOR_TYPE"),
    CURRENT_USER("CURRENT_USER"),
    CURSOR("CURSOR"),
    CYCLE("CYCLE"),
    DATA("DATA"),
    DATABASE("DATABASE"),
    DATABASES("DATABASES"),
    DATA_RETENTION_TIME_IN_DAYS("DATA_RETENTION_TIME_IN_DAYS"),
    DATE("DATE"),
    DATE32("DATE32"),
    DATETIME("DATETIME"),
    DATETIME64("DATETIME64"),
    DAY("DAY"),
    DAYOFWEEK("DAYOFWEEK"),
    DAYOFYEAR("DAYOFYEAR"),
    DAYS("DAYS"),
    DCPROPERTIES("DCPROPERTIES"),
    DEALLOCATE("DEALLOCATE"),
    DEC("DEC"),
    DECADE("DECADE"),
    DECIMAL("DECIMAL"),
    DECLARE("DECLARE"),
    DEDUPLICATE("DEDUPLICATE"),
    DEFAULT("DEFAULT"),
    DEFAULT_DDL_COLLATION("DEFAULT_DDL_COLLATION"),
    DEFERRABLE("DEFERRABLE"),
    DEFERRED("DEFERRED"),
    DEFINE("DEFINE"),
    DEFINED("DEFINED"),
    DEFINER("DEFINER"),
    DELAYED("DELAYED"),
    DELAY_KEY_WRITE("DELAY_KEY_WRITE"),
    DELETE("DELETE"),
    DELIMITED("DELIMITED"),
    DELIMITER("DELIMITER"),
    DELTA("DELTA"),
    DENSE_RANK("DENSE_RANK"),
    DENY("DENY"),
    DEREF("DEREF"),
    DESC("DESC"),
    DESCRIBE("DESCRIBE"),
    DETACH("DETACH"),
    DETAIL("DETAIL"),
    DETERMINISTIC("DETERMINISTIC"),
    DIRECTORY("DIRECTORY"),
    DISABLE("DISABLE"),
    DISCARD("DISCARD"),
    DISCONNECT("DISCONNECT"),
    DISTINCT("DISTINCT"),
    DISTRIBUTE("DISTRIBUTE"),
    DIV("DIV"),
    DO("DO"),
    DOMAIN("DOMAIN"),
    DOUBLE("DOUBLE"),
    DOW("DOW"),
    DOY("DOY"),
    DROP("DROP"),
    DRY("DRY"),
    DUPLICATE("DUPLICATE"),
    DYNAMIC("DYNAMIC"),
    EACH("EACH"),
    ELEMENT("ELEMENT"),
    ELEMENTS("ELEMENTS"),
    ELSE("ELSE"),
    ELSEIF("ELSEIF"),
    EMPTY("EMPTY"),
    ENABLE("ENABLE"),
    ENABLE_SCHEMA_EVOLUTION("ENABLE_SCHEMA_EVOLUTION"),
    ENCODING("ENCODING"),
    ENCRYPTION("ENCRYPTION"),
    END("END"),
    END_EXEC("END-EXEC"),
    ENDPOINT("ENDPOINT"),
    END_FRAME("END_FRAME"),
    END_PARTITION("END_PARTITION"),
    ENFORCED("ENFORCED"),
    ENGINE("ENGINE"),
    ENGINE_ATTRIBUTE("ENGINE_ATTRIBUTE"),
    ENUM("ENUM"),
    ENUM16("ENUM16"),
    ENUM8("ENUM8"),
    EPHEMERAL("EPHEMERAL"),
    EPOCH("EPOCH"),
    EQUALS("EQUALS"),
    ERROR("ERROR"),
    ESCAPE("ESCAPE"),
    ESCAPED("ESCAPED"),
    ESTIMATE("ESTIMATE"),
    EVENT("EVENT"),
    EVERY("EVERY"),
    EVOLVE("EVOLVE"),
    EXCEPT("EXCEPT"),
    EXCEPTION("EXCEPTION"),
    EXCHANGE("EXCHANGE"),
    EXCLUDE("EXCLUDE"),
    EXCLUSIVE("EXCLUSIVE"),
    EXEC("EXEC"),
    EXECUTE("EXECUTE"),
    EXECUTION("EXECUTION"),
    EXISTS("EXISTS"),
    EXP("EXP"),
    EXPANSION("EXPANSION"),
    EXPLAIN("EXPLAIN"),
    EXPLICIT("EXPLICIT"),
    EXPORT("EXPORT"),
    EXTEND("EXTEND"),
    EXTENDED("EXTENDED"),
    EXTENSION("EXTENSION"),
    EXTERNAL("EXTERNAL"),
    EXTERNAL_VOLUME("EXTERNAL_VOLUME"),
    EXTRACT("EXTRACT"),
    FAIL("FAIL"),
    FAILOVER("FAILOVER"),
    FALSE("FALSE"),
    FETCH("FETCH"),
    FIELDS("FIELDS"),
    FILE("FILE"),
    FILES("FILES"),
    FILE_FORMAT("FILE_FORMAT"),
    FILL("FILL"),
    FILTER("FILTER"),
    FINAL("FINAL"),
    FIRST("FIRST"),
    FIRST_VALUE("FIRST_VALUE"),
    FIXEDSTRING("FIXEDSTRING"),
    FLOAT("FLOAT"),
    FLOAT32("FLOAT32"),
    FLOAT4("FLOAT4"),
    FLOAT64("FLOAT64"),
    FLOAT8("FLOAT8"),
    FLOOR("FLOOR"),
    FLUSH("FLUSH"),
    FN("FN"),
    FOLLOWING("FOLLOWING"),
    FOR("FOR"),
    FORCE("FORCE"),
    FORCE_NOT_NULL("FORCE_NOT_NULL"),
    FORCE_NULL("FORCE_NULL"),
    FORCE_QUOTE("FORCE_QUOTE"),
    FOREIGN("FOREIGN"),
    FORMAT("FORMAT"),
    FORMATTED("FORMATTED"),
    FORWARD("FORWARD"),
    FRAME_ROW("FRAME_ROW"),
    FREE("FREE"),
    FREEZE("FREEZE"),
    FROM("FROM"),
    FSCK("FSCK"),
    FULFILLMENT("FULFILLMENT"),
    FULL("FULL"),
    FULLTEXT("FULLTEXT"),
    FUNCTION("FUNCTION"),
    FUNCTIONS("FUNCTIONS"),
    FUSION("FUSION"),
    GENERAL("GENERAL"),
    GENERATE("GENERATE"),
    GENERATED("GENERATED"),
    GEOGRAPHY("GEOGRAPHY"),
    GET("GET"),
    GIN("GIN"),
    GIST("GIST"),
    GLOBAL("GLOBAL"),
    GRANT("GRANT"),
    GRANTED("GRANTED"),
    GRANTS("GRANTS"),
    GRAPHVIZ("GRAPHVIZ"),
    GROUP("GROUP"),
    GROUPING("GROUPING"),
    GROUPS("GROUPS"),
    HASH("HASH"),
    HAVING("HAVING"),
    HEADER("HEADER"),
    HEAP("HEAP"),
    HIGH_PRIORITY("HIGH_PRIORITY"),
    HISTORY("HISTORY"),
    HIVEVAR("HIVEVAR"),
    HOLD("HOLD"),
    HOSTS("HOSTS"),
    HOUR("HOUR"),
    HOURS("HOURS"),
    HUGEINT("HUGEINT"),
    ICEBERG("ICEBERG"),
    ID("ID"),
    IDENTITY("IDENTITY"),
    IDENTITY_INSERT("IDENTITY_INSERT"),
    IF("IF"),
    IGNORE("IGNORE"),
    ILIKE("ILIKE"),
    IMMEDIATE("IMMEDIATE"),
    IMMUTABLE("IMMUTABLE"),
    IMPORT("IMPORT"),
    IMPORTED("IMPORTED"),
    IN("IN"),
    INCLUDE("INCLUDE"),
    INCLUDE_NULL_VALUES("INCLUDE_NULL_VALUES"),
    INCREMENT("INCREMENT"),
    INDEX("INDEX"),
    INDICATOR("INDICATOR"),
    INHERIT("INHERIT"),
    INHERITS("INHERITS"),
    INITIALLY("INITIALLY"),
    INNER("INNER"),
    INOUT("INOUT"),
    INPATH("INPATH"),
    INPLACE("INPLACE"),
    INPUT("INPUT"),
    INPUTFORMAT("INPUTFORMAT"),
    INSENSITIVE("INSENSITIVE"),
    INSERT("INSERT"),
    INSERT_METHOD("INSERT_METHOD"),
    INSTALL("INSTALL"),
    INSTANT("INSTANT"),
    INSTEAD("INSTEAD"),
    INT("INT"),
    INT128("INT128"),
    INT16("INT16"),
    INT2("INT2"),
    INT256("INT256"),
    INT32("INT32"),
    INT4("INT4"),
    INT64("INT64"),
    INT8("INT8"),
    INTEGER("INTEGER"),
    INTEGRATION("INTEGRATION"),
    INTERPOLATE("INTERPOLATE"),
    INTERSECT("INTERSECT"),
    INTERSECTION("INTERSECTION"),
    INTERVAL("INTERVAL"),
    INTO("INTO"),
    INVOKER("INVOKER"),
    IO("IO"),
    IS("IS"),
    ISODOW("ISODOW"),
    ISOLATION("ISOLATION"),
    ISOWEEK("ISOWEEK"),
    ISOYEAR("ISOYEAR"),
    ITEMS("ITEMS"),
    JAR("JAR"),
    JOIN("JOIN"),
    JSON("JSON"),
    JSONB("JSONB"),
    JSONFILE("JSONFILE"),
    JSON_TABLE("JSON_TABLE"),
    JULIAN("JULIAN"),
    KEY("KEY"),
    KEYS("KEYS"),
    KEY_BLOCK_SIZE("KEY_BLOCK_SIZE"),
    KILL("KILL"),
    LAG("LAG"),
    LANGUAGE("LANGUAGE"),
    LARGE("LARGE"),
    LAST("LAST"),
    LAST_VALUE("LAST_VALUE"),
    LATERAL("LATERAL"),
    LEAD("LEAD"),
    LEADING("LEADING"),
    LEFT("LEFT"),
    LEVEL("LEVEL"),
    LIKE("LIKE"),
    LIKE_REGEX("LIKE_REGEX"),
    LIMIT("LIMIT"),
    LINE("LINE"),
    LINES("LINES"),
    LIST("LIST"),
    LISTEN("LISTEN"),
    LISTING("LISTING"),
    LN("LN"),
    LOAD("LOAD"),
    LOCAL("LOCAL"),
    LOCALTIME("LOCALTIME"),
    LOCALTIMESTAMP("LOCALTIMESTAMP"),
    LOCATION("LOCATION"),
    LOCK("LOCK"),
    LOCKED("LOCKED"),
    LOG("LOG"),
    LOGIN("LOGIN"),
    LOGS("LOGS"),
    LONGBLOB("LONGBLOB"),
    LONGTEXT("LONGTEXT"),
    LOWCARDINALITY("LOWCARDINALITY"),
    LOWER("LOWER"),
    LOW_PRIORITY("LOW_PRIORITY"),
    LS("LS"),
    LSEG("LSEG"),
    MACRO("MACRO"),
    MANAGE("MANAGE"),
    MANAGED("MANAGED"),
    MANAGEDLOCATION("MANAGEDLOCATION"),
    MAP("MAP"),
    MASKING("MASKING"),
    MATCH("MATCH"),
    MATCHED("MATCHED"),
    MATCHES("MATCHES"),
    MATCH_CONDITION("MATCH_CONDITION"),
    MATCH_RECOGNIZE("MATCH_RECOGNIZE"),
    MATERIALIZE("MATERIALIZE"),
    MATERIALIZED("MATERIALIZED"),
    MAX("MAX"),
    MAXVALUE("MAXVALUE"),
    MAX_DATA_EXTENSION_TIME_IN_DAYS("MAX_DATA_EXTENSION_TIME_IN_DAYS"),
    MAX_ROWS("MAX_ROWS"),
    MEASURES("MEASURES"),
    MEDIUMBLOB("MEDIUMBLOB"),
    MEDIUMINT("MEDIUMINT"),
    MEDIUMTEXT("MEDIUMTEXT"),
    MEMBER("MEMBER"),
    MERGE("MERGE"),
    MESSAGE("MESSAGE"),
    METADATA("METADATA"),
    METHOD("METHOD"),
    METRIC("METRIC"),
    MICROSECOND("MICROSECOND"),
    MICROSECONDS("MICROSECONDS"),
    MILLENIUM("MILLENIUM"),
    MILLENNIUM("MILLENNIUM"),
    MILLISECOND("MILLISECOND"),
    MILLISECONDS("MILLISECONDS"),
    MIN("MIN"),
    MINUS("MINUS"),
    MINUTE("MINUTE"),
    MINUTES("MINUTES"),
    MINVALUE("MINVALUE"),
    MIN_ROWS("MIN_ROWS"),
    MOD("MOD"),
    MODE("MODE"),
    MODIFIES("MODIFIES"),
    MODIFY("MODIFY"),
    MODULE("MODULE"),
    MONITOR("MONITOR"),
    MONTH("MONTH"),
    MONTHS("MONTHS"),
    MSCK("MSCK"),
    MULTISET("MULTISET"),
    MUTATION("MUTATION"),
    NAME("NAME"),
    NAMES("NAMES"),
    NANOSECOND("NANOSECOND"),
    NANOSECONDS("NANOSECONDS"),
    NATIONAL("NATIONAL"),
    NATURAL("NATURAL"),
    NCHAR("NCHAR"),
    NCLOB("NCLOB"),
    NESTED("NESTED"),
    NETWORK("NETWORK"),
    NEW("NEW"),
    NEXT("NEXT"),
    NFC("NFC"),
    NFD("NFD"),
    NFKC("NFKC"),
    NFKD("NFKD"),
    NO("NO"),
    NOBYPASSRLS("NOBYPASSRLS"),
    NOCREATEDB("NOCREATEDB"),
    NOCREATEROLE("NOCREATEROLE"),
    NOINHERIT("NOINHERIT"),
    NOLOGIN("NOLOGIN"),
    NONE("NONE"),
    NOORDER("NOORDER"),
    NOREPLICATION("NOREPLICATION"),
    NORMALIZE("NORMALIZE"),
    NORMALIZED("NORMALIZED"),
    NOSCAN("NOSCAN"),
    NOSUPERUSER("NOSUPERUSER"),
    NOT("NOT"),
    NOTHING("NOTHING"),
    NOTIFY("NOTIFY"),
    NOWAIT("NOWAIT"),
    NO_WRITE_TO_BINLOG("NO_WRITE_TO_BINLOG"),
    NTH_VALUE("NTH_VALUE"),
    NTILE("NTILE"),
    NULL("NULL"),
    NULLABLE("NULLABLE"),
    NULLIF("NULLIF"),
    NULLS("NULLS"),
    NUMERIC("NUMERIC"),
    NVARCHAR("NVARCHAR"),
    OBJECT("OBJECT"),
    OBJECTS("OBJECTS"),
    OCCURRENCES_REGEX("OCCURRENCES_REGEX"),
    OCTETS("OCTETS"),
    OCTET_LENGTH("OCTET_LENGTH"),
    OF("OF"),
    OFF("OFF"),
    OFFSET("OFFSET"),
    OFFSETS("OFFSETS"),
    OLD("OLD"),
    OMIT("OMIT"),
    ON("ON"),
    ONE("ONE"),
    ONLY("ONLY"),
    OPEN("OPEN"),
    OPENJSON("OPENJSON"),
    OPERATE("OPERATE"),
    OPERATOR("OPERATOR"),
    OPTIMIZATION("OPTIMIZATION"),
    OPTIMIZE("OPTIMIZE"),
    OPTIMIZED("OPTIMIZED"),
    OPTIMIZER_COSTS("OPTIMIZER_COSTS"),
    OPTION("OPTION"),
    OPTIONS("OPTIONS"),
    OR("OR"),
    ORC("ORC"),
    ORDER("ORDER"),
    ORDINALITY("ORDINALITY"),
    ORGANIZATION("ORGANIZATION"),
    OUT("OUT"),
    OUTER("OUTER"),
    OUTPUT("OUTPUT"),
    OUTPUTFORMAT("OUTPUTFORMAT"),
    OVER("OVER"),
    OVERFLOW("OVERFLOW"),
    OVERLAPS("OVERLAPS"),
    OVERLAY("OVERLAY"),
    OVERRIDE("OVERRIDE"),
    OVERWRITE("OVERWRITE"),
    OWNED("OWNED"),
    OWNER("OWNER"),
    OWNERSHIP("OWNERSHIP"),
    PACKAGE("PACKAGE"),
    PACKAGES("PACKAGES"),
    PACK_KEYS("PACK_KEYS"),
    PARALLEL("PARALLEL"),
    PARAMETER("PARAMETER"),
    PARQUET("PARQUET"),
    PART("PART"),
    PARTITION("PARTITION"),
    PARTITIONED("PARTITIONED"),
    PARTITIONS("PARTITIONS"),
    PASSING("PASSING"),
    PASSWORD("PASSWORD"),
    PAST("PAST"),
    PATH("PATH"),
    PATTERN("PATTERN"),
    PER("PER"),
    PERCENT("PERCENT"),
    PERCENTILE_CONT("PERCENTILE_CONT"),
    PERCENTILE_DISC("PERCENTILE_DISC"),
    PERCENT_RANK("PERCENT_RANK"),
    PERIOD("PERIOD"),
    PERMISSIVE("PERMISSIVE"),
    PERSISTENT("PERSISTENT"),
    PIVOT("PIVOT"),
    PLACING("PLACING"),
    PLAN("PLAN"),
    PLANS("PLANS"),
    POINT("POINT"),
    POLICY("POLICY"),
    POLYGON("POLYGON"),
    POOL("POOL"),
    PORTION("PORTION"),
    POSITION("POSITION"),
    POSITION_REGEX("POSITION_REGEX"),
    POWER("POWER"),
    PRAGMA("PRAGMA"),
    PRECEDES("PRECEDES"),
    PRECEDING("PRECEDING"),
    PRECISION("PRECISION"),
    PREPARE("PREPARE"),
    PRESERVE("PRESERVE"),
    PREWHERE("PREWHERE"),
    PRIMARY("PRIMARY"),
    PRINT("PRINT"),
    PRIOR("PRIOR"),
    PRIVILEGES("PRIVILEGES"),
    PROCEDURE("PROCEDURE"),
    PROFILE("PROFILE"),
    PROGRAM("PROGRAM"),
    PROJECTION("PROJECTION"),
    PUBLIC("PUBLIC"),
    PURCHASE("PURCHASE"),
    PURGE("PURGE"),
    QUALIFY("QUALIFY"),
    QUARTER("QUARTER"),
    QUERY("QUERY"),
    QUOTE("QUOTE"),
    RAISE("RAISE"),
    RAISERROR("RAISERROR"),
    RANGE("RANGE"),
    RANK("RANK"),
    RAW("RAW"),
    RCFILE("RCFILE"),
    READ("READ"),
    READS("READS"),
    READ_ONLY("READ_ONLY"),
    REAL("REAL"),
    RECLUSTER("RECLUSTER"),
    RECURSIVE("RECURSIVE"),
    REF("REF"),
    REFERENCES("REFERENCES"),
    REFERENCING("REFERENCING"),
    REGCLASS("REGCLASS"),
    REGEXP("REGEXP"),
    REGR_AVGX("REGR_AVGX"),
    REGR_AVGY("REGR_AVGY"),
    REGR_COUNT("REGR_COUNT"),
    REGR_INTERCEPT("REGR_INTERCEPT"),
    REGR_R2("REGR_R2"),
    REGR_SLOPE("REGR_SLOPE"),
    REGR_SXX("REGR_SXX"),
    REGR_SXY("REGR_SXY"),
    REGR_SYY("REGR_SYY"),
    RELATIVE("RELATIVE"),
    RELAY("RELAY"),
    RELEASE("RELEASE"),
    RELEASES("RELEASES"),
    REMOTE("REMOTE"),
    REMOVE("REMOVE"),
    RENAME("RENAME"),
    REORG("REORG"),
    REPAIR("REPAIR"),
    REPEATABLE("REPEATABLE"),
    REPLACE("REPLACE"),
    REPLICA("REPLICA"),
    REPLICATE("REPLICATE"),
    REPLICATION("REPLICATION"),
    RESET("RESET"),
    RESOLVE("RESOLVE"),
    RESOURCE("RESOURCE"),
    RESPECT("RESPECT"),
    RESTART("RESTART"),
    RESTRICT("RESTRICT"),
    RESTRICTED("RESTRICTED"),
    RESTRICTIONS("RESTRICTIONS"),
    RESTRICTIVE("RESTRICTIVE"),
    RESULT("RESULT"),
    RESULTSET("RESULTSET"),
    RESUME("RESUME"),
    RETAIN("RETAIN"),
    RETURN("RETURN"),
    RETURNING("RETURNING"),
    RETURNS("RETURNS"),
    REVOKE("REVOKE"),
    RIGHT("RIGHT"),
    RLIKE("RLIKE"),
    RM("RM"),
    ROLE("ROLE"),
    ROLES("ROLES"),
    ROLLBACK("ROLLBACK"),
    ROLLUP("ROLLUP"),
    ROOT("ROOT"),
    ROW("ROW"),
    ROWID("ROWID"),
    ROWS("ROWS"),
    ROW_FORMAT("ROW_FORMAT"),
    ROW_NUMBER("ROW_NUMBER"),
    RULE("RULE"),
    RUN("RUN"),
    SAFE("SAFE"),
    SAFE_CAST("SAFE_CAST"),
    SAMPLE("SAMPLE"),
    SAVEPOINT("SAVEPOINT"),
    SCHEMA("SCHEMA"),
    SCHEMAS("SCHEMAS"),
    SCOPE("SCOPE"),
    SCROLL("SCROLL"),
    SEARCH("SEARCH"),
    SECOND("SECOND"),
    SECONDARY("SECONDARY"),
    SECONDARY_ENGINE_ATTRIBUTE("SECONDARY_ENGINE_ATTRIBUTE"),
    SECONDS("SECONDS"),
    SECRET("SECRET"),
    SECURITY("SECURITY"),
    SEED("SEED"),
    SELECT("SELECT"),
    SEMI("SEMI"),
    SENSITIVE("SENSITIVE"),
    SEPARATOR("SEPARATOR"),
    SEQUENCE("SEQUENCE"),
    SEQUENCEFILE("SEQUENCEFILE"),
    SEQUENCES("SEQUENCES"),
    SERDE("SERDE"),
    SERDEPROPERTIES("SERDEPROPERTIES"),
    SERIALIZABLE("SERIALIZABLE"),
    SERVICE("SERVICE"),
    SESSION("SESSION"),
    SESSION_USER("SESSION_USER"),
    SET("SET"),
    SETERROR("SETERROR"),
    SETS("SETS"),
    SETTINGS("SETTINGS"),
    SHARE("SHARE"),
    SHARED("SHARED"),
    SHARING("SHARING"),
    SHOW("SHOW"),
    SIGNED("SIGNED"),
    SIMILAR("SIMILAR"),
    SKIP("SKIP"),
    SLOW("SLOW"),
    SMALLINT("SMALLINT"),
    SNAPSHOT("SNAPSHOT"),
    SOME("SOME"),
    SORT("SORT"),
    SORTED("SORTED"),
    SOURCE("SOURCE"),
    SPATIAL("SPATIAL"),
    SPECIFIC("SPECIFIC"),
    SPECIFICTYPE("SPECIFICTYPE"),
    SPGIST("SPGIST"),
    SQL("SQL"),
    SQLEXCEPTION("SQLEXCEPTION"),
    SQLSTATE("SQLSTATE"),
    SQLWARNING("SQLWARNING"),
    SQRT("SQRT"),
    SRID("SRID"),
    STABLE("STABLE"),
    STAGE("STAGE"),
    START("START"),
    STARTS("STARTS"),
    STATEMENT("STATEMENT"),
    STATIC("STATIC"),
    STATISTICS("STATISTICS"),
    STATS_AUTO_RECALC("STATS_AUTO_RECALC"),
    STATS_PERSISTENT("STATS_PERSISTENT"),
    STATS_SAMPLE_PAGES("STATS_SAMPLE_PAGES"),
    STATUS("STATUS"),
    STDDEV_POP("STDDEV_POP"),
    STDDEV_SAMP("STDDEV_SAMP"),
    STDIN("STDIN"),
    STDOUT("STDOUT"),
    STEP("STEP"),
    STORAGE("STORAGE"),
    STORAGE_INTEGRATION("STORAGE_INTEGRATION"),
    STORAGE_SERIALIZATION_POLICY("STORAGE_SERIALIZATION_POLICY"),
    STORED("STORED"),
    STRAIGHT_JOIN("STRAIGHT_JOIN"),
    STRICT("STRICT"),
    STRING("STRING"),
    STRUCT("STRUCT"),
    SUBMULTISET("SUBMULTISET"),
    SUBSTR("SUBSTR"),
    SUBSTRING("SUBSTRING"),
    SUBSTRING_REGEX("SUBSTRING_REGEX"),
    SUCCEEDS("SUCCEEDS"),
    SUM("SUM"),
    SUPER("SUPER"),
    SUPERUSER("SUPERUSER"),
    SUPPORT("SUPPORT"),
    SUSPEND("SUSPEND"),
    SWAP("SWAP"),
    SYMMETRIC("SYMMETRIC"),
    SYNC("SYNC"),
    SYSTEM("SYSTEM"),
    SYSTEM_TIME("SYSTEM_TIME"),
    SYSTEM_USER("SYSTEM_USER"),
    TABLE("TABLE"),
    TABLES("TABLES"),
    TABLESAMPLE("TABLESAMPLE"),
    TABLESPACE("TABLESPACE"),
    TAG("TAG"),
    TARGET("TARGET"),
    TASK("TASK"),
    TBLPROPERTIES("TBLPROPERTIES"),
    TEMP("TEMP"),
    TEMPORARY("TEMPORARY"),
    TEMPTABLE("TEMPTABLE"),
    TERMINATED("TERMINATED"),
    TERSE("TERSE"),
    TEXT("TEXT"),
    TEXTFILE("TEXTFILE"),
    THEN("THEN"),
    TIES("TIES"),
    TIME("TIME"),
    TIMESTAMP("TIMESTAMP"),
    TIMESTAMPTZ("TIMESTAMPTZ"),
    TIMESTAMP_NTZ("TIMESTAMP_NTZ"),
    TIMETZ("TIMETZ"),
    TIMEZONE("TIMEZONE"),
    TIMEZONE_ABBR("TIMEZONE_ABBR"),
    TIMEZONE_HOUR("TIMEZONE_HOUR"),
    TIMEZONE_MINUTE("TIMEZONE_MINUTE"),
    TIMEZONE_REGION("TIMEZONE_REGION"),
    TINYBLOB("TINYBLOB"),
    TINYINT("TINYINT"),
    TINYTEXT("TINYTEXT"),
    TO("TO"),
    TOP("TOP"),
    TOTALS("TOTALS"),
    TRACE("TRACE"),
    TRAILING("TRAILING"),
    TRANSACTION("TRANSACTION"),
    TRANSIENT("TRANSIENT"),
    TRANSLATE("TRANSLATE"),
    TRANSLATE_REGEX("TRANSLATE_REGEX"),
    TRANSLATION("TRANSLATION"),
    TREAT("TREAT"),
    TRIGGER("TRIGGER"),
    TRIM("TRIM"),
    TRIM_ARRAY("TRIM_ARRAY"),
    TRUE("TRUE"),
    TRUNCATE("TRUNCATE"),
    TRY("TRY"),
    TRY_CAST("TRY_CAST"),
    TRY_CONVERT("TRY_CONVERT"),
    TUPLE("TUPLE"),
    TYPE("TYPE"),
    UBIGINT("UBIGINT"),
    UESCAPE("UESCAPE"),
    UHUGEINT("UHUGEINT"),
    UINT128("UINT128"),
    UINT16("UINT16"),
    UINT256("UINT256"),
    UINT32("UINT32"),
    UINT64("UINT64"),
    UINT8("UINT8"),
    UNBOUNDED("UNBOUNDED"),
    UNCACHE("UNCACHE"),
    UNCOMMITTED("UNCOMMITTED"),
    UNDEFINED("UNDEFINED"),
    UNFREEZE("UNFREEZE"),
    UNION("UNION"),
    UNIQUE("UNIQUE"),
    UNKNOWN("UNKNOWN"),
    UNLISTEN("UNLISTEN"),
    UNLOAD("UNLOAD"),
    UNLOCK("UNLOCK"),
    UNLOGGED("UNLOGGED"),
    UNMATCHED("UNMATCHED"),
    UNNEST("UNNEST"),
    UNPIVOT("UNPIVOT"),
    UNSAFE("UNSAFE"),
    UNSET("UNSET"),
    UNSIGNED("UNSIGNED"),
    UNTIL("UNTIL"),
    UPDATE("UPDATE"),
    UPPER("UPPER"),
    URL("URL"),
    USAGE("USAGE"),
    USE("USE"),
    USER("USER"),
    USER_RESOURCES("USER_RESOURCES"),
    USING("USING"),
    USMALLINT("USMALLINT"),
    UTINYINT("UTINYINT"),
    UUID("UUID"),
    VACUUM("VACUUM"),
    VALID("VALID"),
    VALIDATION_MODE("VALIDATION_MODE"),
    VALUE("VALUE"),
    VALUES("VALUES"),
    VALUE_OF("VALUE_OF"),
    VARBINARY("VARBINARY"),
    VARBIT("VARBIT"),
    VARCHAR("VARCHAR"),
    VARIABLES("VARIABLES"),
    VARYING("VARYING"),
    VAR_POP("VAR_POP"),
    VAR_SAMP("VAR_SAMP"),
    VERBOSE("VERBOSE"),
    VERSION("VERSION"),
    VERSIONING("VERSIONING"),
    VERSIONS("VERSIONS"),
    VIEW("VIEW"),
    VIEWS("VIEWS"),
    VIRTUAL("VIRTUAL"),
    VOLATILE("VOLATILE"),
    VOLUME("VOLUME"),
    WAREHOUSE("WAREHOUSE"),
    WAREHOUSES("WAREHOUSES"),
    WEEK("WEEK"),
    WEEKS("WEEKS"),
    WHEN("WHEN"),
    WHENEVER("WHENEVER"),
    WHERE("WHERE"),
    WHILE("WHILE"),
    WIDTH_BUCKET("WIDTH_BUCKET"),
    WINDOW("WINDOW"),
    WITH("WITH"),
    WITHIN("WITHIN"),
    WITHOUT("WITHOUT"),
    WITHOUT_ARRAY_WRAPPER("WITHOUT_ARRAY_WRAPPER"),
    WORK("WORK"),
    WRITE("WRITE"),
    XML("XML"),
    XMLNAMESPACES("XMLNAMESPACES"),
    XMLTABLE("XMLTABLE"),
    XOR("XOR"),
    YEAR("YEAR"),
    YEARS("YEARS"),
    ZONE("ZONE"),
    ZORDER("ZORDER");

    companion object {
        private val textMap = entries.associateBy { it.text.uppercase() }
        fun fromUpperText(upper: String): KeyWordEnum? = textMap[upper.uppercase()]

        /** These keywords can't be used as a table alias, so that `FROM table_name alias` can be parsed
         * unambiguously without looking ahead.
         */
        val RESERVED_FOR_TABLE_ALIAS: EnumSet<KeyWordEnum> = EnumSet.of(
            // Reserved as both a table and a column alias:
            WITH,
            EXPLAIN,
            ANALYZE,
            SELECT,
            WHERE,
            GROUP,
            SORT,
            HAVING,
            ORDER,
            PIVOT,
            UNPIVOT,
            TOP,
            LATERAL,
            VIEW,
            LIMIT,
            OFFSET,
            FETCH,
            UNION,
            EXCEPT,
            INTERSECT,
            MINUS,
            // Reserved only as a table alias in the `FROM`/`JOIN` clauses:
            ON,
            JOIN,
            INNER,
            CROSS,
            FULL,
            LEFT,
            RIGHT,
            NATURAL,
            USING,
            CLUSTER,
            DISTRIBUTE,
            GLOBAL,
            ANTI,
            SEMI,
            RETURNING,
            ASOF,
            MATCH_CONDITION,
            // for MSSQL-specific OUTER APPLY (seems reserved in most dialects)
            OUTER,
            SET,
            QUALIFY,
            WINDOW,
            END,
            FOR,
            // for MYSQL PARTITION SELECTION
            PARTITION,
            // for Clickhouse PREWHERE
            PREWHERE,
            SETTINGS,
            FORMAT,
            // for Snowflake START WITH .. CONNECT BY
            START,
            CONNECT,
            // Reserved for snowflake MATCH_RECOGNIZE
            MATCH_RECOGNIZE,
            // Reserved for Snowflake table sample
            SAMPLE,
            TABLESAMPLE,
            FROM,
            OPEN
        )

        /** Can't be used as a column alias. so that `SELECT <expr> alias`can be parsed unambiguously
         * without looking ahead.
         */
        val RESERVED_FOR_COLUMN_ALIAS: EnumSet<KeyWordEnum> = EnumSet.of(
            // Reserved as both a table and a column alias:
            WITH,
            EXPLAIN,
            ANALYZE,
            SELECT,
            WHERE,
            GROUP,
            SORT,
            HAVING,
            ORDER,
            TOP,
            LATERAL,
            VIEW,
            LIMIT,
            OFFSET,
            FETCH,
            UNION,
            EXCEPT,
            INTERSECT,
            MINUS,
            CLUSTER,
            DISTRIBUTE,
            RETURNING,
            // Reserved only as a column alias in the `SELECT` clause
            FROM,
            INTO,
            END
        )

        /** Global list of reserved keywords allowed after FROM. Parser should call
         * Dialect::get_reserved_keyword_after_from to allow for each dialect to customize the list.
         */
        val RESERVED_FOR_TABLE_FACTOR: EnumSet<KeyWordEnum> = EnumSet.of(
            INTO,
            LIMIT,
            HAVING,
            WHERE
        )

        /** Global list of reserved keywords that cannot be parsed as identifiers without special handling
         * like quoting. Parser should call `Dialect::is_reserved_for_identifier` to allow for each
         * dialect to customize the list.
         */
        val RESERVED_FOR_IDENTIFIER: EnumSet<KeyWordEnum> = EnumSet.of(
            EXISTS,
            INTERVAL,
            STRUCT,
            TRIM
        )
    }

}